<template>
  <el-dialog
    :visible.sync="visible"
    :close-on-click-modal="false"
    append-to-body
    :before-close="beforeClose"
    top="30px"
    width="1000px"
  >
    <el-tabs>
      <el-tab-pane label="担保意向函">
        <letter-view :related-data="relatedData"></letter-view>
      </el-tab-pane>
      <el-tab-pane label="联保函" v-if="+this.relatedData.gua_type === 1 && !this.isOrgBank">
        <union-letter :related-data="relatedData" :isView="true"></union-letter>
      </el-tab-pane>
      <!-- <el-tab-pane label="联保函"
                   v-if="+this.relatedData.gua_type === 1">
        <union-view :related-data="relatedData"></union-view>
      </el-tab-pane> -->
      <el-tab-pane label="附件">
        <attach-view :queryId="relatedData.customer_related_id" :visible="visible"></attach-view>
      </el-tab-pane>
    </el-tabs>
  </el-dialog>
</template>
<script>
import LetterView from '@/credit/views/county/mission/components/LetterView'
// import UnionView from '@/credit/views/county/mission/components/UnionView'
import AttachView from '@/credit/components/AttachView'
import UnionLetter from '@/credit/views/county/mission/components/UnionLetter'
import { mapGetters } from 'vuex'
export default {
  components: {
    LetterView,
    UnionLetter,
    AttachView,
  },
  props: {
    visible: Boolean,
    relatedData: {
      type: Object,
      default: () => ({}),
    },
  },
  computed: {
    ...mapGetters(['org']),
    isOrgBank() {
      return this.org.orgClass === 'org_bank'
    },
  },
  methods: {
    beforeClose() {
      this.$emit('update:visible', false)
    },
  },
}
</script>
<style lang="scss" scoped></style>
